package com.donleo.security.controller;


import com.donleo.common.api.CommonResult;
import com.donleo.security.service.UserRoleRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户角色关联表 前端控制器
 * </p>
 *
 * @author liangd
 * @since 2020-12-21
 */
@RestController
@RequestMapping("/userRoleRelation")
public class UserRoleRelationController {

    @Autowired
    private UserRoleRelationService userRoleRelationService;

    @GetMapping("/findByUserCode")
    public CommonResult findByUserCode(String userCode){
        return userRoleRelationService.findByUserCode(userCode);
    }

    /**
     * 判断是否是教练
     */
    @GetMapping("/isCoach")
    public CommonResult isCoach(String userCode){
        return userRoleRelationService.isCoach(userCode);
    }

}
